fix(devtools): add zeditor option for Zed on Arch Linux#932
fix(devtools): add zeditor option for Zed on Arch Linux#932
Conversation
📝 WalkthroughWalkthroughA single new editor option "Zed (zeditor)" has been added to the editorOptions list in the DevTools Settings page configuration. This expands the available editor choices without modifying any existing logic or behavior. Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/devtools/client/pages/settings.vue (1)
33-44:⚠️ Potential issue | 🔴 CriticalBackend does not support
zeditor— this change will fail at runtime.While
zeditoris the correct binary name used by Arch Linux and other distributions, thelaunch-editornpm package (v2.12.0, latest as of Oct 2025) has built-in support only forzed, notzeditor. The backend code atpackages/devtools/src/server-rpc/general.ts:224directly passes the editor value tolaunch-editorwithout additional handling.Selecting this option will fail to open files because
launch-editorwill not recognizezeditor. You need to either:
- Map
zeditorto the built-inzedkey in the backend (though this won't work on systems where the binary is namedzeditor), or- Add backend logic to handle
zeditorvia customLAUNCH_EDITORenvironment variable support🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/devtools/client/pages/settings.vue` around lines 33 - 44, The editor option "Zed (zeditor)" in the editorOptions array will send the value 'zeditor' to launch-editor which does not recognize it; update the UI or backend so selecting that option works: either change the frontend editorOptions entry to use the supported value 'zed' instead of 'zeditor' (i.e. keep the label "Zed (zeditor)" but set value 'zed'), or add a short mapping in the backend before calling launch-editor (detect 'zeditor' and map it to 'zed' or consult LAUNCH_EDITOR env var) where the code invokes launch-editor; reference editorOptions and the backend call that forwards the editor value to launch-editor and implement one of these fixes so the runtime value is supported.
🧹 Nitpick comments (1)
packages/devtools/client/pages/settings.vue (1)
39-39: Consider also covering thezeditrename variant as a follow-up.Zed's official Linux documentation notes that third-party packages commonly rename the binary to either
zeditorzeditorto avoid conflicts. This PR correctly addszeditor, butzeditis similarly a real binary name in some distributions and is not yet covered. A follow-up option['Zed (zedit)', 'zedit']could address that gap, though it's outside the stated scope of this PR.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/devtools/client/pages/settings.vue` at line 39, Add an additional option for the alternative Zed binary name by inserting a new entry ['Zed (zedit)', 'zedit'] alongside the existing ['Zed (zeditor)', 'zeditor'] in the editors/options array in settings.vue so distributions that install the binary as "zedit" are also recognized; locate the array that currently contains ['Zed (zeditor)', 'zeditor'] and add the new tuple near it.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@packages/devtools/client/pages/settings.vue`:
- Around line 33-44: The editor option "Zed (zeditor)" in the editorOptions
array will send the value 'zeditor' to launch-editor which does not recognize
it; update the UI or backend so selecting that option works: either change the
frontend editorOptions entry to use the supported value 'zed' instead of
'zeditor' (i.e. keep the label "Zed (zeditor)" but set value 'zed'), or add a
short mapping in the backend before calling launch-editor (detect 'zeditor' and
map it to 'zed' or consult LAUNCH_EDITOR env var) where the code invokes
launch-editor; reference editorOptions and the backend call that forwards the
editor value to launch-editor and implement one of these fixes so the runtime
value is supported.
---
Nitpick comments:
In `@packages/devtools/client/pages/settings.vue`:
- Line 39: Add an additional option for the alternative Zed binary name by
inserting a new entry ['Zed (zedit)', 'zedit'] alongside the existing ['Zed
(zeditor)', 'zeditor'] in the editors/options array in settings.vue so
distributions that install the binary as "zedit" are also recognized; locate the
array that currently contains ['Zed (zeditor)', 'zeditor'] and add the new tuple
near it.
Summary
Zed (zeditor)option in DevTools settings for environments where the Zed binary is exposed aszeditorZed(zed) option unchanged to avoid behavior changes on other platformsWhy this is needed
On some Linux distributions (notably Arch Linux), the Zed package exposes the executable as
zeditorinstead ofzed.Before this change, users selecting
Zedin DevTools would fail to open files from "Open in editor" despite having Zed installed, because DevTools passedzedtolaunch-editor.Adding an explicit
zeditoroption:zed.